package com.metis.document.parse.dialog.utils;

import java.util.concurrent.CompletableFuture;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ThreadPoolUtils {
    @Async("heightTaskExecutor")
    public CompletableFuture<Void> heightThreadPool(Runnable runnable) {
        runnable.run();
        return CompletableFuture.completedFuture(null);
    }

    @Async("lowTaskExecutor")
    public CompletableFuture<Void> lowThreadPool(Runnable runnable) {
        runnable.run();
        return CompletableFuture.completedFuture(null);
    }
}
